package ru.ifmo;

import sofia_kp.SSAP_sparql_response;
import sofia_kp.iKPIC_subscribeHandler2;

import java.util.Vector;

/**
 * Created by Admin on 13.02.15.
 */
public class SortingLineHandler implements iKPIC_subscribeHandler2 {

    private SortingLine robot;

    public SortingLineHandler(SortingLine robot) {
        this.robot = robot;
    }

    @Override
    public void kpic_RDFEventHandler(Vector<Vector<String>> added, Vector<Vector<String>> removed, String s, String s1) {
        if (added.size() == 1) {
            SmartSpaceTriplet data = new SmartSpaceTriplet(added.elementAt(0));
            if (data.getSubject().equals("Grabber") && data.getPredicate().equals("hasStatus")) {
                robot.runCycle();
            }
        }
    }

    @Override
    public void kpic_SPARQLEventHandler(SSAP_sparql_response ssap_sparql_response, SSAP_sparql_response ssap_sparql_response1, String s, String s1) {

    }

    @Override
    public void kpic_UnsubscribeEventHandler(String s) {

    }

    @Override
    public void kpic_ExceptionEventHandler(Throwable throwable) {

    }
}
